Cache Playwright browsers and bound install timeout in CI#14415
Merged
Conversation
Install Playwright Browsers step in test-smokes.yml currently has no timeout and re-downloads browser binaries on every run. A recent CI run showed three ubuntu buckets stuck for 2+ hours on this step while another bucket finished the same step in 41 seconds on a sibling runner — the failure mode looks like transient runner/network hangs rather than slow installs. Set PLAYWRIGHT_BROWSERS_PATH at job level to pin the browsers install location to a path under github.workspace that is identical across Linux, Windows, and macOS. This lets a single actions/cache entry restore browsers on any runner OS without the default-per-OS path variance, and ensures install + test steps agree on the location. Cache is keyed on the resolved Playwright version (read via node -p on the installed @playwright/test package.json so the key tracks what npm actually resolved, not the stale lockfile). Keep --with-deps as-is per upstream guidance (microsoft/playwright#20603). Add timeout-minutes: 10 so a stuck runner fails fast instead of blocking the matrix until the 6h job cap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recent CI runs showed the "Install Playwright Browsers" step hanging for 2+ hours on a subset of ubuntu-latest runners while sibling runners in the same workflow run finished the same step in ~40s. Since the step has no timeout, a stuck runner burns until GitHub's 6h job cap and blocks the smoke-test matrix.
Changes
PLAYWRIGHT_BROWSERS_PATHat job level to pin the browsers install location to a single path undergithub.workspacethat resolves identically on Linux, Windows, and macOS. Install and test steps inherit the env, so they agree on the location.actions/cache@v5, keyed on the resolved Playwright version (read from the installed@playwright/testpackage.jsonvianode -p, not from the lockfile — current lockfile is stale).timeout-minutes: 10on the install step so a hung runner fails fast.npx playwright install --with-depsas-is per upstream Playwright guidance ([BUG] How to cache playwright OS binaries in github actions? microsoft/playwright#20603).Verification
Non-goals
tests/integration/playwright/package-lock.json(1.47.0 pinned whilepackage.jsonspecifies^1.59.1). Tangential cleanup.